package com.itheima.fanshe;

import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Properties;
/*
使用配置文件动态的运行类
 */
public class Demo03 {

    public static void main(String[] args) throws Exception {

       /* Student student = new Student();
        student.study();*/
       /* Teacher teacher = new Teacher();
        teacher.teach();*/
        Properties prop = new Properties();
        prop.load(ClassLoader.getSystemResourceAsStream("a.properties"));
        Class<?> clazz = Class.forName(prop.getProperty("classname"));
        Method method = clazz.getDeclaredMethod(prop.getProperty("methodname"));

        method.invoke(clazz.newInstance());




    }
}
